<?php
/**  
* pagemgr.php
* 
*  
*/

require_once(CLASS_PATH."/__autoload.php");

class Pagemgr extends Module
{
	public $load_args, $ctrl;

	public function __construct($page, $obj, $vi)
	{
		parent::__construct($page);	
			
		$this->page->set_control($obj);		
		$this->ctrl 		= $this->page->get_control(); 
		$this->load_args 	= $this->page->get_args();  
		$this->vi 			= $vi;
	}

	public function create() 
	{	
		require_once(CLASS_PATH."/search/{$this->ctrl}Controller.php");
		require_once(CLASS_PATH."/search/{$this->vi}View.php");
		
		$controllerName = "{$this->ctrl}Controller";
		$controller     = new $controllerName($this->load_args);
		
		$view = $controller->get_view();
		$body = $view->display();
		
		return $body;
	}

}
?>